package com.core.androidlearndemo;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.cmonbaby.photoselector.PhotoPickerActivity;
import com.cmonbaby.photoselector.config.PhotoPickerConfig;
import com.cmonbaby.photoselector.utils.Constants;
import com.core.androidlearndemo.dragger2.Dragger2TestActivity;
import com.core.androidlearndemo.imagecompress.ImageCompressTestActivity;
import com.core.androidlearndemo.livedata.LiveDataMainActivity;
import com.core.androidlearndemo.plugs.PluginTestActivity;
import com.core.androidlearndemo.uidemo.PaintTestActivity;
import com.netease.imageSelector.ImageSelector;
import com.netease.imageSelector.ImageSelectorConfiguration;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.text).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                CCResult result = CC.obtainBuilder("ComponentA")
//                        .setActionName("showActivity")
//                        .build()
//                        .call();
//                startActivity(new Intent());
//                ImageSelectorConfiguration imageSelectorConfiguration = ImageSelectorConfiguration.createDefault(MainActivity.this);
//                ImageSelector.getInstance().init(imageSelectorConfiguration);
                PhotoPickerConfig pickerConfig = PhotoPickerConfig.getDefaultConfig();
                Intent intent = new Intent(MainActivity.this, PhotoPickerActivity.class);
                Bundle bundle = new Bundle();
                bundle.putSerializable(Constants.PICKER_CONFIG,pickerConfig);
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });
        findViewById(R.id.dragger2_btn).setOnClickListener(this);
        findViewById(R.id.plugin_btn).setOnClickListener(this);
        findViewById(R.id.imagecompress_btn).setOnClickListener(this);
        findViewById(R.id.paint_btn).setOnClickListener(this);
        findViewById(R.id.livedata_btn).setOnClickListener(this);
        findViewById(R.id.layoutmanager_btn).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.dragger2_btn:
                startActivity(new Intent(this, Dragger2TestActivity.class));
                break;
            case R.id.plugin_btn:
                startActivity(new Intent(this, PluginTestActivity.class));
                break;
            case R.id.imagecompress_btn:
                startActivity(new Intent(this, ImageCompressTestActivity.class));
                break;
            case R.id.paint_btn:
                startActivity(new Intent(this, PaintTestActivity.class));
                break;
            case R.id.livedata_btn:
                startActivity(new Intent(this, LiveDataMainActivity.class));
                break;
            case R.id.layoutmanager_btn:

                break;
        }
    }
}
